﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Defilade
{
    /// <summary>
    /// A dialog for updating the settings XML file
    /// </summary>
    public partial class SettingsDialog : Form
    {
        /// <summary>
        /// Only used for stupid VS Designer
        /// </summary>
        private SettingsDialog()
        {
            InitializeComponent();
            Settings = new Settings();
        }

        /// <summary>
        /// Creates a new SettingsDialog with all of the items populated
        /// from the indicated settings file
        /// </summary>
        /// <param name="settings">the settings file to display</param>
        public SettingsDialog(Settings settings)
        {
            if (settings != null)
            {
                Settings = new Settings(settings);
            }
            InitializeComponent();
            Reset();
        }

        public Settings Settings
        {
            get;
            set;
        }

        private void Reset()
        {
        }
        
        private void okayButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}
